Skip to content

fix: E2E member test flake from stale test data and unclosed dialog (#215)#219

Merged
zacharias-ona merged 1 commit into
mainfrom
fix/215-e2e-member-duplicate
Apr 17, 2026
Merged

fix: E2E member test flake from stale test data and unclosed dialog (#215)#219
zacharias-ona merged 1 commit into
mainfrom
fix/215-e2e-member-duplicate

Conversation

@zacharias-ona
Copy link
Copy Markdown
Collaborator

Closes #215

What

The E2E test "owner can re-invite and invited user can accept" fails with a strict mode violation because locator('text=E2E Member') resolves to 2 elements. The root cause is stale test data from previous runs whose afterAll cleanup was interrupted (process killed, timeout). A leftover user with display_name "E2E Member" remains as a member of the workspace, so the next run's newly invited user creates a second matching element.

A secondary flake in "owner can remove a member" was also fixed: the remove confirmation dialog did not close after clicking "Remove" because AlertDialogAction (Base UI) is a plain Button that does not auto-close the dialog.

How

  1. Stale test data cleanup: Added cleanupStaleTestUsers() helper that finds profiles by display name and deletes them via the existing deleteTestUser flow. Called in both beforeAll (defensive) and afterAll (fallback when invitedUserId is unset).

  2. Dialog close fix: The MemberList component now controls the AlertDialog open state via openDialogMemberId. After the async handleRemove completes, the state is set to null, closing the dialog reliably regardless of router.refresh() timing.

Testing

  • All 54 E2E tests pass in the full parallel suite, including the previously flaky tests 38 and 45
  • pnpm lint && pnpm typecheck && pnpm test all pass (226 unit tests)
  • Member test file passes in isolation: npx playwright test e2e/members.spec.ts (7/7)

@vercel
Copy link
Copy Markdown

vercel Bot commented Apr 17, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
memo Ready Ready Preview, Comment Apr 17, 2026 11:29pm

Request Review

@zacharias-ona zacharias-ona merged commit b2de345 into main Apr 17, 2026
6 checks passed
@zacharias-ona zacharias-ona deleted the fix/215-e2e-member-duplicate branch April 17, 2026 23:32
@zacharias-ona
Copy link
Copy Markdown
Collaborator Author

✅ UI verification passed — design spec compliance confirmed.

Static analysis: The only UI change (src/components/members/member-list.tsx) adds controlled open/onOpenChange state to the AlertDialog component. No visual changes — colors, typography, spacing, component variants, and accessibility attributes are all unchanged and compliant with .agents/design.md.

Visual verification: Screenshots of the Members settings page (desktop 1280×800 and mobile 375×812, dark mode) confirm the member list renders correctly with no layout regressions.

@zacharias-ona
Copy link
Copy Markdown
Collaborator Author

✅ Post-merge verification passed.

E2E suite: 57/57 tests passed against https://memo.software-factory.dev

Ad-hoc smoke tests:

  • ✅ Landing page — loaded, has title
  • /sign-in — rendered with email input
  • /api/health — returned OK
  • /dashboard — not 500 (redirects unauthenticated as expected)
  • ✅ Authenticated login flow — sign-in redirected to workspace
  • ✅ Workspace page — fully loaded
  • ✅ No console errors (unauthenticated or authenticated)

Skipped:

  • Editor navigation via sidebar — no page buttons with timestamp text found in workspace (test data dependent)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug: E2E flake — "owner can re-invite and invited user can accept" strict mode violation

1 participant